<?php
  if(!empty($listpost)){
?>
<div class="activities_block container widget">
  <!--
  Cached at <?php echo date('H:i:s');?>
  -->
  <h2><img src="<?php echo $imagepath;?>/icon_activities.png" alt="กิจกรรม">Truck Service</h2>
    <?php
        foreach ($listpost as $key => $value) {
    ?>
      <div class="activities-list">
        <div class="activities-widget-image">
        <?php
          if(!empty($value["images"][0]["small"])){
            ?>
            <a href="<?php echo base_url('forum/view/'.$value["url"]);?>" target="_blank"><img src="<?php echo base_url($value["images"][0]["small"])?>" /></a>
            <?php
          }else{
            ?>
            <a href="<?php echo base_url('forum/view/'.$value["url"]);?>" target="_blank"><img src="<?php echo $imagepath."/not_available-2.jpg"?>" /></a>
            <?php
          }
        ?>
        </div>
        <a class="title-link" href="<?php echo base_url('forum/view/'.$value["url"]);?>" target="_blank"><strong><?php echo $value["title"];?></strong></a>
        <!--
        <div class="muted"><small><?php //echo mb_substr(strip_tags($value["content"]), 0, 60,"UTF-8");?>...</small></div>
        -->
      </div>
    <?php 
        }
    ?>
</div>
<?php
  }
?>